package com.ccys.db.entity;

import com.ccys.db.rely.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 病人
 * <p>
 * Created by Mybatis Generator on 2023/12/18
 */
@Data
@Table(name = "tbl_member")
@NoArgsConstructor
@AllArgsConstructor
public class TblMember extends BaseEntity {
    /**
     * 自动生成，在前端展示为用户编号 patient no.
     */
    @ApiModelProperty("自动生成，在前端展示为用户编号")
    @Column(name = "member_no")
    private String memberNo;

    /**
     * 名称前部分
     */
    @Column(name = "first_name")
    private String firstName;

    /**
     * 名称后部分
     */
    @Column(name = "last_name")
    private String lastName;

    /**
     * 加密方式:PBKDF2-SHA1
     */
    @ApiModelProperty("加密方式:PBKDF2-SHA1")
    private String password;


    private String email;

    /**
     * 后端页面的ID 就是该字段  标识身份证号
     */
    @Column(name = "nric_fin")
    private String nricFin;

    /**
     * 后端传过来的
     */
    /*@Column(name = "home_address")
    private String homeAddress;

    @Column(name = "office_address")
    private String officeAddress;*/

    /**
     * 0 女 1 男 -1 未知
     * female 女,male 男，unknown 未知
     */
    @ApiModelProperty("0 女 1 男 -1 未知")
    private Integer gender;

    private String phone;

    /**
     * 生日
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("生日")
    private Date dob;

    /**
     * 注册日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("注册日期")
    private Date regdate;

    /**
     * 最后一次访问时间 todo 需要讨论一下
     */
    @Column(name = "last_visit")
    @ApiModelProperty("最后一次访问时间 todo 需要讨论一下")
    private Date lastVisit;

    /**
     * 最后一次修改密码的时间
     */
    @Column(name = "last_change_password")
    @ApiModelProperty("最后一次修改密码的时间")
    private Date lastChangePassword;

    /**
     * 密码错误次数
     */
    @Column(name = "failed_password_attempts")
    @ApiModelProperty("密码错误次数")
    private Integer failedPasswordAttempts;

    /**
     * 账号锁定
     */
    @ApiModelProperty("账号锁定")
    private Integer locked;

    /**
     * 锁定时间
     */
    @Column(name = "locked_on")
    @ApiModelProperty("锁定时间")
    private Date lockedOn;

    /**
     * 激活状态 输入 OTP 之后改为 1
     */
    @ApiModelProperty("激活状态 输入 OTP 之后改为1    Activated 1，  Pending activation 0")
    private Integer actived;

    /**
     * OTP验证码
     */
    @Column(name = "active_code")
    @ApiModelProperty("OTP验证码")
    private String activeCode;

    /**
     * 发送验证码的时间
     */
    @Column(name = "request_active_date")
    @ApiModelProperty("发送验证码的时间")
    private Date requestActiveDate;

    private Integer status;

    /**
     * 头像
     */
    @ApiModelProperty("头像")
    private String image;

    /**
     * 证件正面
     */
    @Column(name = "front_identification_photo")
    @ApiModelProperty("证件正面")
    private String frontIdentificationPhoto;

    /**
     * 证件反面
     */
    @Column(name = "back_identification_photo")
    @ApiModelProperty("证件反面")
    private String backIdentificationPhoto;

    /**
     * 家长/监护人账号 id
     * parentId 为空 标识self   ，不为空标识 child
     * patient Type
     */
    @Column(name = "parent_id")
    @ApiModelProperty("家长/监护人账号 id")
    private String parentId;

    /**
     * 父账号关系 1parent 2guardian 3mother 4father
     */
    @ApiModelProperty("父账号关系 1parent 2guardian 3mother 4father")
    private Integer relationship;

    @Column(name = "emergency_first_name")
    private String emergencyFirstName;

    @Column(name = "emergency_last_name")
    private String emergencyLastName;

    @Column(name = "emergency_country_id")
    private String emergencyCountryId;

    @Column(name = "emergency_phone")
    private String emergencyPhone;

    @Column(name = "emergency_relationship")
    private String emergencyRelationship;

    /**
     * todo
     */
    @Column(name = "mem_request_update_contact_info")
    @ApiModelProperty("todo")
    private Integer memRequestUpdateContactInfo;

    /**
     * todo
     */
    @Column(name = "mem_temp_lock_to")
    @ApiModelProperty("todo")
    private Date memTempLockTo;

    /**
     * 1:NRIC_FIN 2:Passport 3:Birth_certificate 4:Driving_license 5:Child_photo
     */
    @ApiModelProperty("1:NRIC_FIN 2:Passport 3:Birth_certificate 4:Driving_license 5:Child_photo")
    private Integer type;

/*
    *//**
     * 护照照片
     * use the front_identification_card     2024-02-26   确认使用 front_identification_photo 字段
     *//*
    @ApiModelProperty("护照照片")
    private String passport;

    *//**
     * 出生证明照片
     * use the front_identification_card
     *//*
    @Column(name = "birth_certificate")
    @ApiModelProperty("出生证明照片")
    private String birthCertificate;

    *//**
     * 驾照正面
     * use the front_identification_card
     *//*
    @Column(name = "front_driving_license")
    @ApiModelProperty("驾照正面")
    private String frontDrivingLicense;

    *//**
     * 驾照反面
     * use the back_identification_card
     *//*
    @Column(name = "back_driving_license")
    @ApiModelProperty("驾照反面")
    private String backDrivingLicense;*/

    /**
     * 某种卡的正面照
     *//*
    @Column(name = "front_general_card")
    @ApiModelProperty("某种卡的正面照")
    private String frontGeneralCard;

    *//**
     * 某种卡的反面照
     *//*
    @Column(name = "back_general_card")
    @ApiModelProperty("某种卡的反面照")
    private String backGeneralCard;*/

    private Integer g6pd;

    private Integer pregnant;

    @Column(name = "news_letter")
    private Integer newsLetter;



    /**
     * 联系电话的国家ID
     */
    @Column(name = "phone_country_id")
    @ApiModelProperty("联系电话的国家ID ")
    private String phoneCountryId;

    @Column(name = "aia_identifier")
    private String aiaIdentifier;

    @Column(name = "aia_member")
    private Integer aiaMember;

    /**
     * 每次更换国家时同步国家的时区
     */
    @ApiModelProperty("每次更换国家时同步国家的时区")
    private Integer currentCountryTimezone;

    private BigDecimal weight;

    private BigDecimal height;


    /**
     * 是否测试账号
     */
    @Column(name = "test_account")
    @ApiModelProperty("是否测试账号")
    private Integer testAccount;

    /**
     * 猜测app设置
     */
    @Column(name = "can_show_add_profile_screen")
    @ApiModelProperty("猜测app设置")
    private Integer canShowAddProfileScreen;

    /**
     * 猜测app设置
     */
    @Column(name = "can_show_profile_email_activated")
    @ApiModelProperty("猜测app设置")
    private Integer canShowProfileEmailActivated;

    /**
     * 首次登陆时间
     */
    @Column(name = "first_visit")
    @ApiModelProperty("首次登陆时间")
    private Date firstVisit;

    /**
     * 重新发验证码次数
     */
    @Column(name = "number_of_resend_otp")
    @ApiModelProperty("重新发验证码次数")
    private Integer numberOfResendOtp;

    /**
     * 验证码输错次数
     */
    @Column(name = "number_of_retry_otp")
    @ApiModelProperty("验证码输错次数")
    private Integer numberOfRetryOtp;

    /**
     * 最后一次输错验证码时间
     */
    @Column(name = "last_time_retry_otp")
    @ApiModelProperty("最后一次输错验证码时间")
    private Date lastTimeRetryOtp;

    /**
     * 现在所在国家
     */
    @Column(name = "current_country")
    @ApiModelProperty("所在国家")
    private String currentCountry;


    /**
     * todo
     */
    @Column(name = "is_alias_mixpanel")
    @ApiModelProperty("todo")
    private Integer isAliasMixpanel;

    /**
     * 语言简拼，如果做国际化需要让前端选择语言并存储id
     */
    @Column(name = "current_language")
    @ApiModelProperty("语言简拼，如果做国际化需要让前端选择语言并存储id")
    private String currentLanguage;

    @Column(name = "singpass_uuid")
    private String singpassUuid;

    /**
     * 国籍
     */
    @ApiModelProperty("国籍")
    private String nationality;

    /**
     * 也许在app设置
     */
    @Column(name = "checked_add_allergy")
    @ApiModelProperty("也许在app设置")
    private Integer checkedAddAllergy;

    /**
     * 也许在app设置
     */
    @Column(name = "checked_add_longterm")
    @ApiModelProperty("也许在app设置")
    private Integer checkedAddLongterm;

    /**
     * app 端传的
     */
    @Column(name = "location_address")
    private String locationAddress;

    @Column(name = "location_country")
    private String locationCountry;

    @Column(name = "location_latitude")
    private BigDecimal locationLatitude;

    @Column(name = "location_longitude")
    private BigDecimal locationLongitude;


    /**
     * web 端修改
     */
    @Column(name = "location_floor_number")
    private String locationFloorNumber;

    @Column(name = "location_postal_code")
    private String locationPostalCode;

    @Column(name = "location_city")
    private String locationCity;

    /**
     * 后端 state 使用
     */
    @Column(name = "location_state")
    private String locationState;

    @Column(name = "location_detail_address")
    private String locationDetailAddress;

    /**
     * todo
     */
    @Column(name = "mem_inactived_counter")
    @ApiModelProperty("todo")
    private Integer memInactivedCounter;

    /**
     * todo
     */
    @Column(name = "mem_inactived_date")
    @ApiModelProperty("todo")
    private Date memInactivedDate;

    /**
     * 医生端操作是否确认
     */
    @Column(name = "doctor_verified")
    @ApiModelProperty("医生端操作是否确认")
    private Integer doctorVerified;

    @Column(name = "verified_doctor_id")
    private String verifiedDoctorId;

    @Column(name = "singpass_gender")
    private Integer singpassGender;

    /**
     * 病人修改的新nric存储在此字段，医生确认后覆盖到nric_fin
     */
    @Column(name = "pending_nric")
    @ApiModelProperty("病人修改的新nric存储在此字段，医生确认后覆盖到nric_fin")
    private String pendingNric;

    /**
     * todo
     */
    @Column(name = "is_need_verify_when_register")
    @ApiModelProperty("todo")
    private Integer isNeedVerifyWhenRegister;

    @Column(name = "child_photo")
    private String childPhoto;

    /**
     * 0	Child
     * 1	Wife
     * 2	Husband
     * 3	Brother
     * 4	Sister
     * 5	Father
     * 6	Mother
     * 7	Son
     * 8	Daughter
     * 9	Domestic helper
     * 10	Grandfather
     * 11	Grandmother
     * 12	Others
     */
    @Column(name = "mem_emergency_relationship_id")
    @ApiModelProperty("0\tChild\n" +
            "1\tWife\n" +
            "2\tHusband\n" +
            "3\tBrother\n" +
            "4\tSister\n" +
            "5\tFather\n" +
            "6\tMother\n" +
            "7\tSon\n" +
            "8\tDaughter\n" +
            "9\tDomestic helper\n" +
            "10\tGrandfather\n" +
            "11\tGrandmother\n" +
            "12\tOthers")
    private String memEmergencyRelationshipId;

    /**
     * 如果有设置from_paypal_gateway=1的卡，设置为0不提示
     */
    @Column(name = "can_show_paypal_prompt")
    @ApiModelProperty("如果有设置from_paypal_gateway=1的卡，设置为0不提示")
    private Integer canShowPaypalPrompt;

    /**
     * 目前只有越南病人需要设置4位密码，与登录密码同样加密方式
     */
    @ApiModelProperty("目前只有越南病人需要设置4位密码，与登录密码同样加密方式")
    private String pincode;

    @Column(name = "salt_pincode")
    private String saltPincode;

    @Column(name = "iteration_pincode")
    private Integer iterationPincode;

    @Column(name = "activated_pincode")
    private Integer activatedPincode;

    /**
     * 是否可以使用think well,todo在哪儿设置
     */
    @Column(name = "access_thinkwell")
    @ApiModelProperty("是否可以使用think well,todo在哪儿设置")
    private Integer accessThinkwell;

    /**
     * 前端传入是否保持登录状态
     */
    @Column(name = "mem_stay_logged_in")
    @ApiModelProperty("前端传入是否保持登录状态")
    private Boolean memStayLoggedIn;

    /**
     * 第一次使用think well的时间
     */
    @Column(name = "first_visit_thinkwell")
    @ApiModelProperty("第一次使用think well的时间")
    private Date firstVisitThinkwell;

    @Column(name = "salt_password")
    @ApiModelProperty("盐密码")
    private String saltPassword;
    @Column(name = "iteration_password")
    @ApiModelProperty("迭代次数密码")
    private Integer iterationPassword;

    @Column(name = "device_id")
    @ApiModelProperty("推送标识，前端传入的push_notification_token")
    private String deviceId;

    @Column(name = "device_type")
    @ApiModelProperty("设备 1ios 2 android 3 Huawei ")
    private Integer deviceType;
}